#include "EbnCMEnergyHist.h"

CEbnCMEnergyHist::CEbnCMEnergyHist(CEbnCompetenceModule * cm)
{
    mpCM = cm;
}

CEbnCMEnergyHist::~CEbnCMEnergyHist(void)
{
    mEnergyHist.clear();
}

void CEbnCMEnergyHist::addEnergyHist(float energy)
{
    mEnergyHist.push_back(energy);
}

int CEbnCMEnergyHist::getEnergyHistCount(void)
{
    return (int)mEnergyHist.size();
}
	
float CEbnCMEnergyHist::getEnergyHist(int time)
{
    if (time <=0 || (time > (int)mEnergyHist.size()))
    {
            return 0;
    }

    return mEnergyHist.at(time - 1);
}

bool CEbnCMEnergyHist::isHostCompetenceModule(CEbnCompetenceModule * cm)
{
    if (cm == mpCM)
    {
            return true;
    }

    return false;
}
